home *** CD-ROM | disk | FTP | other *** search
- Path: news.massey.ac.nz!sysadmin
- From: Matthew.Hook.1@massey.ac.nz
- Newsgroups: comp.lang.c
- Subject: Re: Why doesn't this work?
- Date: Wed, 06 Mar 1996 11:46:56 +1300
- Organization: Massey University, Palmerston North, New Zealand
- Message-ID: <313CC460.6279@uni.massey.ac.nz>
- References: <1996Mar4.161412.137442@forest>
- NNTP-Posting-Host: smis-tararua.massey.ac.nz
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.5 sun4d)
-
- ebromber@forest.drew.edu wrote:
-
- #include bla bla bla???????
-
- > main();
- --snip--
- pass[count]=c;
- > putch('*');
- > }
- > if (count!=4) { printf("\nWRONG PASSWORD\n"); main();}
- > error=0;
- > for (i=0; i<4; i++)
- > if (real[i]=pass[i]) error++;
- here is you problem ***
- look closely now!!
- > if (error>0) {printf("\nWRONG PASSWORD\n"); main();}
- > }
-
-
- By the way this is quite a sloppy piece of code (actually it sux)
- but I'll let you off being an obvious first timer and all.
- I personally would use strcmp() for the comparison and not bothered
- storing the actual password. i.e if strcmp(pass, "jerk") dothis; from
- memory.
-